= Phusion Passenger Standalone users guide

image:images/phusion_banner.png[link="http://www.phusion.nl/"]

link:https://www.phusionpassenger.com/[Phusion Passenger] is a web server and application server, designed to be fast, robust and lightweight. It runs your web apps with the least amount of hassle by taking care of almost all administrative heavy lifting for you. Advanced administration tools allow you to gain deep insight into your web applications' operations and to keep your servers healthy. Phusion Passenger is polyglot by design, and currently supports Ruby (Rack), Python (WSGI) and Node.js.

In the Standalone mode, Phusion Passenger operates as a fully-featured, secure standalone HTTP server. You do not need to have an existing web server like Apache or Nginx. This mode is ideal...

 * ...if you are not familiar with Apache or Nginx
 * ...when you want to quickly start up a server without editing configuration files (e.g. during development)
 * ...or when you want to decouple the web server from the application server, by setting up reverse proxies.

== Support information

include::users_guide_snippets/support_information.txt[]


[[installation]]
== Installation

include::users_guide_snippets/installation.txt[]


== Usage

Go to your application's root directory, and run:

------------------------------
passenger start
------------------------------

== Configuration

=== Command line options

Most configuration is done by customizing the arguments passed to the `passenger` command. The most important ones are:

`--port NUMBER`::
	The port number that Phusion Passenger should listen on. Defaults to 3000.
`--environment NAME`::
	Customizes the value of the `RAILS_ENV`, `RACK_ENV` and `PASSENGER_ENV` environment variable. The default is "development".
`--max-pool-size NUMBER`::
	The maximum number of application processes to run. The maximum number that you can run depends on the amount of memory your server has. The article link:http://blog.phusion.nl/2013/03/12/tuning-phusion-passengers-concurrency-settings/[Tuning Phusion Passenger's concurrency settings] explains how you can infer a good number for this option.
`--min-instances NUMBER`::
	If you don't want the number of application processes to scale dynamically, then use this option to set it to a value equal to `--max-pool-size`.
`--spawn-method NAME`::
	When set to "smart" (the default), Phusion Passenger preloads your app and utilizes copy-on-write in order to save memory. You can disable this by setting this option to "direct". Preloading is only supported for Ruby apps. For apps written in other languages, it is as if "direct" is always used.
`--no-friendly-error-pages`::
	If your app fails to start, Phusion Passenger will tell you by showing a friendly error page in the browser. This option disables it.

See `--help` for all available options.

=== Advanced configuration

Phusion Passenger Standalone is built on the same technology that powers link:Users%20guide%20Nginx.html[Phusion Passenger for Nginx], so any configuration option supported by Phusion Passenger for Nginx can be applied to Standalone as well. You can do this by editing the Standalone configuration template directly.

First, go to the directory where Phusion Passenger is installed:

-------------------------------------
cd $(passenger-config --root)
-------------------------------------

Then open the file `resources/templates/standalone/config.erb`.

NOTE: If you installed Phusion Passenger using the Debian or Ubuntu packages, then the filename is `/usr/share/passenger/templates/standalone/config.erb` or `/usr/share/passenger-enterprise/templates/standalone/config.erb`.

Please note that changes to this file only last until you reinstall or upgrade Phusion Passenger. We are currently working on a mechanism for permanently editing the configuration file.


[[troubleshooting]]
== Troubleshooting

include::users_guide_snippets/troubleshooting/default.txt[]

[[about_environment_variables]]
== Appendix: About environment variables

include::users_guide_snippets/environment_variables.txt[]
